/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.qinyeit.serviceapp.entity.enums.State;
import lombok.Builder;
import lombok.experimental.Tolerate;

import javax.persistence.*;

/**
 * ClassName: Department <br/>
 * Function: 部门 <br/>
 * date: 2018-11-20 13:19:32 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="departments")
public class Department extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 名称 
    @Column(name="name", length = 300)
	private String name = null;

	// 区域id
	@ManyToOne
    @JoinColumn(name="district_id")
	private District district = null;

	// 操作人
	@Column(name="operator")
	private Long operator = null;

	// 操作人
	@Column(name="operator_name")
	private String operatorName = null;

	// 状态
	@Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private State state = State.NORMAL;



    @Tolerate
	public Department() {
		
	}
    @Tolerate
	public Department(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取名称
	 */
	public String getName() {
		return this.name;
	}

    /**
     * 设置名称
     */
	public Department setName(String name) {
		this.name = name;
		return this;
	}

	public District getDistrict() {
		return district;
	}

	public void setDistrict(District district) {
		this.district = district;
	}

	public Long getOperator() {
		return operator;
	}

	public void setOperator(Long operator) {
		this.operator = operator;
	}

	public String getOperatorName() {
		return operatorName;
	}

	public void setOperatorName(String operatorName) {
		this.operatorName = operatorName;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}
}
